<?php
		include("session.inc");
		include("dbconn.inc");
		include("dbfuc.inc");		
		$user=$_SESSION["user"];
		$curid=$_SESSION["curid"];
		$dbconnection=$_SESSION["dbconnection"];		
	if(session_is_registered("dbconnection") )
	{
	
?>
<html>
<head>
<title>inner</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.style1 {	font-size: 9px;
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-weight: bold;
}
.style7 {font-family: Geneva, Arial, Helvetica, sans-serif}
-->
</style>
<link href="stylesheet.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF">
<!-- ImageReady Slices (inner.psd) -->
<table id="Table_01" width="1003" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td colspan="10"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1003" height="167">
          <param name="movie" value="images/inner_header.swf">
          <param name="quality" value="high">
          <embed src="images/inner_header.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1003" height="167"></embed>
	    </object></td>
	</tr>
	<tr>
		<td rowspan="2">
			<img src="images/inner_02.jpg" width="220" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_03.jpg" width="98" height="29" alt=""></td>
		<td>
			<img src="images/inner_04.jpg" width="44" height="6" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_05.jpg" width="47" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_06.jpg" width="54" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_07.jpg" width="102" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_08.jpg" width="96" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_09.jpg" width="124" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_10.jpg" width="106" height="29" alt=""></td>
		<td rowspan="2">
			<img src="images/inner_11.jpg" width="112" height="29" alt=""></td>
	</tr>
	<tr>
		<td>
			<img src="images/inner_12.jpg" width="44" height="23" alt=""></td>
	</tr>
	<tr>
		<td height="19" background="images/inner_15.jpg">&nbsp;</td>
		<td colspan="9" rowspan="2" valign="top" bgcolor="#FFFFFF"><p>&nbsp;</p>
          <table width="98%" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td><?php
		if(($user!="") && (($curid!="") || ($curid!=0)))
		{
			$sql="";
?>		
<?php	
			$current_point=0;
			$sql="select n_point from point_master where n_id=$curid ";
			$result=mysql_query($sql);
			$rownum=mysql_num_rows($result);
			if($rownum >0)
			{
				$rownum=$rownum-1;
				$current_point=mysql_result($result,$rownum,"n_point");
			
			}		

		

?> 
<br>
<br>
<table width="724" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#999999">
  <tr bgcolor="#5AC5F9">
    <td height="25" colspan="6" bgcolor="#FFFFFF"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FF0000" size="2"><strong>Amount Transfer Details of : <?php echo $user ?> </strong></font></td>
  </tr>
  <tr>
    <td width="28" height="18" bgcolor="#CCCCCC"><div align="center" class="style17">Slno</div></td>
    <td width="242" bgcolor="#CCCCCC"><div align="center" class="style17">TRANSACTION DETAILS</div></td>
    <td width="122" bgcolor="#CCCCCC"><div align="center" class="style17">VOUCHER NO </div></td>
    <td width="115" bgcolor="#CCCCCC"><div align="center" class="style17">DATE </div></td>
    <td width="112" bgcolor="#CCCCCC"><div align="center" class="style17">CREADIT </div></td>
    <td width="91" bgcolor="#CCCCCC"><div align="center" class="style17">DEBIT </div></td>
  </tr>
  <?php		
		$slno=0;$tot_credit=0;$tot_debit=0;$credit_amount=0;
		$sql="select N_FROM_ID,N_TO_ID,C_TRAN_TYPE,N_VOUCHUR,N_AMOUT,N_DEDUCTION,D_DATE from transcation_details  where N_TO_ID=$curid ";
		$result=mysql_query($sql);
		$rownum=mysql_num_rows($result);
		while($rownum >0)
		{
			$slno=$slno+1;
			$rownum=$rownum-1;
			$fromid=mysql_result($result,$rownum,"N_FROM_ID");
			$toid=mysql_result($result,$rownum,"N_TO_ID");
			$date=mysql_result($result,$rownum,"D_DATE");
			$trans_type=mysql_result($result,$rownum,"C_TRAN_TYPE");
			$vouchure=mysql_result($result,$rownum,"N_VOUCHUR");
			$amount=mysql_result($result,$rownum,"N_AMOUT");	
			$deduction=mysql_result($result,$rownum,"N_DEDUCTION");		

			if($trans_type=="CREDIT"){
			 	$tran_details="Received From - ".get_username($fromid);
				$credit_amount=$amount;
				$debit_amount=$deduction;
				$tot_credit=$tot_credit+$credit_amount;
			}
			else
			{		
				$tran_details="Transfered to  - ".get_username($fromid);
				$debit_amount=$amount;
				$credit_amount=0;
				$tot_debit=$tot_debit+$debit_amount;
			}
?>
  <tr bgcolor="#666666">
    <td bgcolor="#FFFFFF" class="style5"><div align="center"><?php echo $slno ?></div></td>
    <td bgcolor="#FFFFFF" class="style5"><div align="left"><?php echo $tran_details ?> </div></td>
    <td bgcolor="#FFFFFF" class="style5"><div align="center"><?php echo $vouchure ?></div></td>
    <td bgcolor="#FFFFFF" class="style5"><div align="center"><?php echo $date ?></div></td>
    <td bgcolor="#FFFFFF" class="style5"><div align="center"><?php echo $credit_amount ?> </div></td>
    <td bgcolor="#FFFFFF" class="style5"><div align="center"><?php echo $debit_amount ?> </div></td>
  </tr>
  <?php  
	}    
  if($slno==0)
  {
?>
  <tr>
    <td colspan="6" class="style5"><div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" color="#FF0000" size="2"><strong>No Records Available</strong></font></div></td>
  </tr>
  <?php
  }
?>
</table>
<br>
<table width="531" border="0" align="center" cellpadding="1" cellspacing="1">
  <tr>
    <td width="192"><span class="style37">Tottal Credit amount </span></td>
    <td width="10"><span class="style37">:</span></td>
    <td width="319"><span class="style37"><?php echo $tot_credit ?></span></td>
  </tr>
  <tr>
    <td><span class="style37">Tottal Debit amount </span></td>
    <td><span class="style37">:</span></td>
    <td><span class="style37"><?php echo $tot_debit ?></span></td>
  </tr>
  <tr>
    <td><span class="style37">Current balance amount </span></td>
    <td><span class="style37">:</span></td>
    <td><span class="style37"><?php echo $current_point ?></span></td>
  </tr>
</table></td>
            </tr>
          </table>          
          <p>&nbsp;</p>
</td>
	</tr>
	<tr>
		<td valign="top" background="images/inner_15.jpg"><table width="95%" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td><div class="arrowlistmenu">
                <ul>
                  <li><a href="validation_success.php" class="style1 style7">Control Panal  </a></li>
                  <li><a href="registration_step1.php" class="style1">Registration</a></li>
                  <li><a href="geneology.php" class="style1">Geneology </a></li>
                  <li><a href="amount_transfer.php" class="style1">Amount Transfer  </a></li>
                  <li><a href="amount_transfer_details.php" class="style1">Transaction Details  </a></li>
                  <li><a href="pindetails.php" class="style7">Received Coupon Details  </a></li>
				  <li><a href="user_profile.php" class="style7">View Profile   </a></li>
				  <li><a href="change_password.php" class="style7">Password Change </a></li>
				  <li><a href="logout.php" class="style7">Logout  </a></li>
                </ul>
            </div></td>
          </tr>
        </table>	    <p>&nbsp;</p></td>
	</tr>
	<tr>
		<td colspan="10">
			<img src="images/inner_16.jpg" width="1003" height="23" alt=""></td>
	</tr>
</table>
<!-- End ImageReady Slices -->
</body>
</html>

<?php
	}
	}
	else
	{
		$errormsg="Your session is expeired. Please login again.";
		header("location: index.php?error=$errormsg");
	}
?>	
